<template>
  <el-input-number
    :model-value="modelValue"
    @update:modelValue="$emit('update:modelValue', $event)"
    :min="min"
    :max="max"
    :step="step"
    :precision="precision"
    :disabled="disabled"
    :controls="controls"
    :controls-position="controlsPosition"
    :placeholder="placeholder"
    class="axiom-input-number"
    :class="{ 'axiom-input-number--block': block }"
    v-bind="$attrs"
  />
</template>

<script setup>
defineOptions({
  name: 'AxiomInputNumber'
});

defineProps({
  modelValue: { type: Number, default: 0 },
  min: { type: Number, default: -Infinity },
  max: { type: Number, default: Infinity },
  step: { type: Number, default: 1 },
  precision: { type: Number },
  disabled: { type: Boolean, default: false },
  controls: { type: Boolean, default: true },
  controlsPosition: { type: String, default: 'right' },
  placeholder: { type: String, default: '' },
  block: { type: Boolean, default: false },
});

defineEmits(['update:modelValue']);
</script> 